<template>
  <div class="nav-tab" :style="{ backgroundColor: backcolor }">
    <div class="tab-left"><slot name="tab-left"></slot></div>
    <div class="tab-center"><slot name="tab-center"></slot></div>
    <div class="tab-right"><slot name="tab-right"></slot></div>
  </div>
</template>

<script>
export default {
  name: "nav-tab",
  props: {
    backcolor: {
      type: String,
      defaultvalue: "pink",
    },
  },
};
</script>

<style scoped>
.nav-tab {
  position: fixed;
  top: 0;
  z-index: 9;
  display: flex;
  height: 44px;
  line-height: 44px;
  width: 100%;
  background-color: pink;
  box-shadow: 0 1px 1px rgba(189, 149, 179, 0.3);
  border-radius: 3px;
  text-align: center;
}
.tab-left,
.tab-right {
  text-align: center;
  width: 60px;
}
.tab-center {
  /* 其他设置了宽度，则剩下的一个flex设为1时，占满剩下的全部 */
  flex: 1;
}
</style>